import 'package:factoryside/bean/prod_model_entity.dart';

prodModelEntityFromJson(ProdModelEntity data, Map<String, dynamic> json) {
	if (json['Id'] != null) {
		data.id = json['Id'] is String
				? int.tryParse(json['Id'])
				: json['Id'].toInt();
	}
	if (json['ID'] != null) {
		data.iD = json['ID'] is String
				? int.tryParse(json['ID'])
				: json['ID'].toInt();
	}
	if (json['ModelName'] != null) {
		data.modelName = json['ModelName'].toString();
	}
	if (json['FactoryID'] != null) {
		data.factoryID = json['FactoryID'].toString();
	}
	if (json['IsUse'] != null) {
		data.isUse = json['IsUse'].toString();
	}
	if (json['SpecificationsID'] != null) {
		data.specificationsID = json['SpecificationsID'] is String
				? int.tryParse(json['SpecificationsID'])
				: json['SpecificationsID'].toInt();
	}
	if (json['Version'] != null) {
		data.version = json['Version'] is String
				? int.tryParse(json['Version'])
				: json['Version'].toInt();
	}
	return data;
}

Map<String, dynamic> prodModelEntityToJson(ProdModelEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['Id'] = entity.id;
	data['ID'] = entity.iD;
	data['ModelName'] = entity.modelName;
	data['FactoryID'] = entity.factoryID;
	data['IsUse'] = entity.isUse;
	data['SpecificationsID'] = entity.specificationsID;
	data['Version'] = entity.version;
	return data;
}